import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/userservice/tb-user/findByPage',
    method: 'get',
    params
  })
}
export function getDept() {
  return request({
    url: 'http://localhost:8081/departmentservice/tb-department/findDeptAndCount',
    method: 'get'
  })
}
export function delUser(id) {
  return request({
    url: '/userservice/tb-user/delusers',
    method: 'delete',
    params:{
      id
    }
  })
}
export function AddUser(TbUser) {
  return request({
    url: '/userservice/tb-user/addUser',
    method: 'post',
    data:JSON.stringify(TbUser),
    headers:{
      'Content-Type': 'application/json; charset=UTF-8'
    }
  })
}
export function editUser(id) {
  return request({
    url:'/userservice/tb-user/findById',
    method: 'get',
    params:{
      Id:id
    }
  })
}
export function updUser(TbUser) {
  return request({
    url: '/userservice/tb-user/updUser',
    method: 'put',
    data:JSON.stringify(TbUser),
    headers:{
      'Content-Type': 'application/json; charset=UTF-8'
    }
  })
}
